home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xpcom / nsIConverterInputStream.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  117 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIConverterInputStream.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIConverterInputStream_h__
  6. #define __gen_nsIConverterInputStream_h__
  7.  
  8.  
  9. #ifndef __gen_nsIUnicharInputStream_h__
  10. #include "nsIUnicharInputStream.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIInputStream; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsIConverterInputStream */
  21. #define NS_ICONVERTERINPUTSTREAM_IID_STR "fc66ffb6-5404-4908-a4a3-27f92fa0579d"
  22.  
  23. #define NS_ICONVERTERINPUTSTREAM_IID \
  24.   {0xfc66ffb6, 0x5404, 0x4908, \
  25.     { 0xa4, 0xa3, 0x27, 0xf9, 0x2f, 0xa0, 0x57, 0x9d }}
  26.  
  27. /**
  28.  * A unichar input stream that wraps an input stream.
  29.  * This allows reading unicode strings from a stream, automatically converting
  30.  * the bytes from a selected character encoding.
  31.  */
  32. class NS_NO_VTABLE nsIConverterInputStream : public nsIUnicharInputStream {
  33.  public: 
  34.  
  35.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONVERTERINPUTSTREAM_IID)
  36.  
  37.   /**
  38.      * Default replacement char value, U+FFFD REPLACEMENT CHARACTER.
  39.      */
  40.   enum { DEFAULT_REPLACEMENT_CHARACTER = 65533U };
  41.  
  42.   /**
  43.      * Initialize this stream.
  44.      * @param aStream 
  45.      *        The underlying stream to read from.
  46.      * @param aCharset
  47.      *        The character encoding to use for converting the bytes of the
  48.      *        stream. A null charset will be interpreted as UTF-8.
  49.      * @param aBufferSize
  50.      *        How many bytes to buffer.
  51.      * @param aReplacementChar
  52.      *        The character to replace unknown byte sequences in the stream
  53.      *        with. The standard replacement character is U+FFFD.
  54.      *        A value of 0x0000 will cause an exception to be thrown if unknown
  55.      *        byte sequences are encountered in the stream.
  56.      */
  57.   /* void init (in nsIInputStream aStream, in string aCharset, in long aBufferSize, in PRUnichar aReplacementChar); */
  58.   NS_IMETHOD Init(nsIInputStream *aStream, const char *aCharset, PRInt32 aBufferSize, PRUnichar aReplacementChar) = 0;
  59.  
  60. };
  61.  
  62. /* Use this macro when declaring classes that implement this interface. */
  63. #define NS_DECL_NSICONVERTERINPUTSTREAM \
  64.   NS_IMETHOD Init(nsIInputStream *aStream, const char *aCharset, PRInt32 aBufferSize, PRUnichar aReplacementChar); 
  65.  
  66. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  67. #define NS_FORWARD_NSICONVERTERINPUTSTREAM(_to) \
  68.   NS_IMETHOD Init(nsIInputStream *aStream, const char *aCharset, PRInt32 aBufferSize, PRUnichar aReplacementChar) { return _to Init(aStream, aCharset, aBufferSize, aReplacementChar); } 
  69.  
  70. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  71. #define NS_FORWARD_SAFE_NSICONVERTERINPUTSTREAM(_to) \
  72.   NS_IMETHOD Init(nsIInputStream *aStream, const char *aCharset, PRInt32 aBufferSize, PRUnichar aReplacementChar) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aStream, aCharset, aBufferSize, aReplacementChar); } 
  73.  
  74. #if 0
  75. /* Use the code below as a template for the implementation class for this interface. */
  76.  
  77. /* Header file */
  78. class nsConverterInputStream : public nsIConverterInputStream
  79. {
  80. public:
  81.   NS_DECL_ISUPPORTS
  82.   NS_DECL_NSICONVERTERINPUTSTREAM
  83.  
  84.   nsConverterInputStream();
  85.  
  86. private:
  87.   ~nsConverterInputStream();
  88.  
  89. protected:
  90.   /* additional members */
  91. };
  92.  
  93. /* Implementation file */
  94. NS_IMPL_ISUPPORTS1(nsConverterInputStream, nsIConverterInputStream)
  95.  
  96. nsConverterInputStream::nsConverterInputStream()
  97. {
  98.   /* member initializers and constructor code */
  99. }
  100.  
  101. nsConverterInputStream::~nsConverterInputStream()
  102. {
  103.   /* destructor code */
  104. }
  105.  
  106. /* void init (in nsIInputStream aStream, in string aCharset, in long aBufferSize, in PRUnichar aReplacementChar); */
  107. NS_IMETHODIMP nsConverterInputStream::Init(nsIInputStream *aStream, const char *aCharset, PRInt32 aBufferSize, PRUnichar aReplacementChar)
  108. {
  109.     return NS_ERROR_NOT_IMPLEMENTED;
  110. }
  111.  
  112. /* End of implementation class template. */
  113. #endif
  114.  
  115.  
  116. #endif /* __gen_nsIConverterInputStream_h__ */
  117.